#pragma once

#include <QWidget>
#include "ui_hollowWidget.h"
#include "modelSoft.h"
#include "TopTools_ListOfShape.hxx"
#include <hollowFeature.h>

QT_BEGIN_NAMESPACE
namespace Ui { class hollowWidgetClass; };
QT_END_NAMESPACE

class hollowWidget : public QWidget
{
	Q_OBJECT

public:
	hollowWidget(modelSoft* myModelSoft,QWidget *parent = nullptr);
	~hollowWidget();

protected:
	void createConnection();
	void onClickModify();
	void onClickConfirm();
	//void onClickCancel();
	virtual void closeEvent(QCloseEvent* event) override;
	void onClickShapeSelect();
	void onClickFaceSelect();
	void OnCancelSelShape();
	void OnCancelSelFace();

public:
	void receiveHollowSelectedShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline);

private:
	Ui::hollowWidgetClass *ui;
	modelSoft* myModelSoft;
	double D;
	double tolerance;
	//0:shape, 1:face
	int selectType;
	bool isModified;
	TopTools_ListOfShape facesToRemove;
	HollowFeature* hollowFeature;
	Handle(QIVtkSelectionPipeline) selectPipeline;
	Handle(QIVtkSelectionPipeline) resultPipeline;
	bool confirmCreated = false;
	bool faceReceive = false;
	bool shapeReceive = false;
};
